/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.SRPviolation.impl;

import za.ac.cput.SRPviolation.BankAccount;

/**
 *
 * @author Enkosi
 */
public class BankAccountImpl implements BankAccount{

    private String name;
    private String accountNumber;
    private int balance;
    
    public BankAccountImpl(){
    }
    
    public BankAccountImpl(String nm, String accNum, int bal){
        this.name = nm;
        this.accountNumber = accNum;
        this.balance = bal;
    }
    @Override
    public int withdraw(int amount) {
        return balance - amount;
    }

    @Override
    public int deposit(int amount) {
        return this.balance + amount;
    }

    @Override
    public String printDetails() {
      return ("Type: " + this.getName() + " " + this.getAccountNumber() + " " + this.getBalance());
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the accountNumber
     */
    public String getAccountNumber() {
        return accountNumber;
    }

    /**
     * @param accountNumber the accountNumber to set
     */
    public void setAccountNumber(String accountNumber) {
        this.accountNumber = accountNumber;
    }

    /**
     * @return the balnce
     */
    public int getBalance() {
        return balance;
    }

    /**
     * @param balnce the balnce to set
     */
    public void setBalance(int balance) {
        this.balance = balance;
    }
    
}
